package gewu.suleju.sevice.imp;

import gewu.suleju.dao.iml.IBrokerInfo;
import gewu.suleju.dao.iml.IHouseInforDao;
import gewu.suleju.dao.iml.IUserDao;
import gewu.suleju.model.pojo.BrokerInfo;
import gewu.suleju.model.pojo.HouseInfor;
import gewu.suleju.sevice.IUploadHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UploadHouseServiceImp implements IUploadHouseService {
    @Autowired
    private IHouseInforDao iHouseInforDao;
    @Autowired
    private IBrokerInfo iBrokerInfo;
    @Autowired
    private IUserDao iUserDao;
    @Override
    public void updateUser(String name ,String phone ,Integer id) {
        iUserDao.updateUser(name,phone,id);
    }

    @Override
    public BrokerInfo findByServiceArea(String serviceArea) {
        return iBrokerInfo.findByServiceArea(serviceArea);
    }

    @Override
    public Integer isHavePic(Integer isPic) {
        HouseInfor i = iHouseInforDao.findByIsPic(isPic);
        return i.getId();

    }

    @Override
    public void isPic(Integer id) {
        iHouseInforDao.updateIsPic(id);
    }

}
